// ****************** prototype *******************************

// m here = minute = 60 * second
// h here = hour   = 60 * minute
// K               = 1000
// KK works as 10^6
// s here = second = 1000


// ******** infrastructure *************

Analog.NBits                 =    12   // 8, 10, 12, or 13
Analog.ReadAveraging         =     1   // 1(1)32
Board.BatteryDivider         =     0.0824
Board.LoggingToUSD           =     1
Board.SendingToBase          =     1   // ******** not checked ***********
Board.msBlinkLength          =   200
Board.msMaxInactivity        =    30s
Board.Name                   =   'prototype'
Board.Nominal3V3             =     3.304  // for fudging analog read
Board.Tag                    =   'P'
DS1307.msJogDelay            =     6s // ******** not checked ***********
FileSystem.NewFileNameQDay   =     1
XBee.BaseID                  =   200
XBee.BaudRate                = 38400

// ********* sensors ******************

ACDetect_1.InUse       =  0
ACDetect_2.InUse       =  0
BMP085.InUse           =  0
depth.InUse            =  0
DHT22_1.InUse          =  0
DHT22_2.InUse          =  0
lightning.InUse        =  0 
relay_1.InUse          =  1    
resistance_1.InUse     =  0     // light
resistance_2.InUse     =  0
resistance_3.InUse     =  0     // wind direction
SPS30.InUse            =  0     
switch_1.InUse         =  1     // wind speed
switch_2.InUse         =  0     // rain
VC0706.InUse           =  0
voltage_1.InUse        =  0     
voltage_2.InUse        =  0

ACDetect_2.SensorTag   =  'A'
BMP085.SensorTag       =  'B'
DHT22_2.SensorTag      =  'D'
depth.SensorTag        =  'd'
DHT22_1.SensorTag      =  'E'
ACDetect_1.SensorTag   =  'F'
resistance_1.SensorTag =  'L'
voltage_1.SensorTag    =  'P'
voltage_2.SensorTag    =  'p'
switch_2.SensorTag     =  'R'
SPS30.SensorTag        =  'S'
relay_1.SensorTag      =  'T'
switch_1.SensorTag     =  'W'
resistance_3.SensorTag =  'w'
lightning.SensorTag    =  'Z'
// ********* details ******************
ACDetect_1.ACPresentIfBelow          =    0.5
ACDetect_1.Furnace                   =    1
ACDetect_1.Observed                  =  'furnace'
ACDetect_1.usReadingInterval         =    6mK

// ----

ACDetect_2.AC                        =    1
ACDetect_2.ACPresentIfBelow          =    0.5
ACDetect_2.Observed                  =  'A/C'
ACDetect_2.usReadingInterval         =    6mK

// ----

BMP085.Fahrenheit                    =    1
BMP085.Observed                      =  'shop'
BMP085.usReadingInterval             =    3mK
BMP085.MaxPressureInches             =   35
BMP085.MinPressureInches             =   22
BMP085.MaxTempC                      =   50
BMP085.MinTempC                      =  -40
BMP085.ReportTemp                    =    1
BMP085.Singleton                     =    1


// ----

depth.Damping                        =    0.9
depth.DepthInchesDry                 =    6   // min depth
depth.DepthInchesWet                 =   14   // max depth
depth.LowerOhms                      =   10K
depth.msCurrentDuration              =    1s
depth.msNominalReportInterval        =    2m   // 2h
depth.ProbeOhmsDry                   =   18.87K
depth.ProbeOhmsWet                   =    5K
depth.UpperOhms                      =   10K
depth.usReadingInterval              =   1mK  // 10mK

// ----

DHT22_1.Fahrenheit                   =    1
DHT22_1.Observed                     =  'pond'
DHT22_1.MaxTempC                     =   50
DHT22_1.MinTempC                     =  -40
DHT22_1.usReadingInterval            =    2mK
DHT22_1.ReportRH                     =    0

// ----

DHT22_2.Damping                      =    0.9
DHT22_2.Fahrenheit                   =    1
DHT22_2.Observed                     =  'office'
DHT22_2.MaxTempC                     =   50
DHT22_2.MinTempC                     =  -40
DHT22_2.usReadingInterval            =    2mK
DHT22_2.ReportRH                     =    1
DHT22_2.Singleton                    =    0

// ----

lightning.FlashesNeeded              =    1    // 1, 5, 9, 16
lightning.Indoor                     =   18   // 0x12
lightning.MaskDisturbance            =    0   // false
lightning.NoiseFloor                 =    2   // 1 ..7
lightning.Outdoor                    =   14   // 0xE
lightning.SpikeThreshold             =    2   // 1 .. 11
lightning.SPIPortSpeed               =    2KK
lightning.Threshold                  =    2   // 1 .. 10  watchdog, disturbance resistance
lightning.usReadingInterval          =   30mK

// ----

relay_1.usReadingInterval            =    1mK
relay_1.FollowSwitch                 =    1
relay_1.SwitchToFollow               =    1 // 1-based
relay_1.WhichRecentTemp              =    2 // 1, 2 DHT22s; 3 BMP085

// ----

resistance_1.Damping                 =    0.9
resistance_1.Light                   =    1
resistance_1.Light100                =    0.93
resistance_1.Light000                =    0.07
resistance_1.msNominalReportInterval =   10m
resistance_1.Observed                = 'light'
resistance_1.UpperOhms               =   4.7K
resistance_1.usReadingInterval       =    1mK
resistance_1.WindDirection           =    0

// ----

resistance_2.Damping                 =    0.9
resistance_2.Light                   =    0
resistance_2.msNominalReportInterval =   10m
resistance_2.UpperOhms               =   33K
resistance_2.usReadingInterval       =    1mK
resistance_2.WindDirection           =    0

// ----

resistance_3.Damping                 =    0.9
resistance_3.Light                   =    0
resistance_3.msNominalReportInterval =    2m
resistance_3.Observed                = 'wind direction'
resistance_3.UpperOhms               =   10K
resistance_3.usReadingInterval       =    1mK
resistance_3.WindDirection           =    1

// ----

SPS30.AutoCleanDisabled              =    0
SPS30.AutoCleanIntervalHours         =    1
SPS30.AutoCleanImmediately           =    1
SPS30.usReadingInterval              =    1mK

// ----

// switch_1 modal
switch_1.EventCounter                =    0  // exactly one of these should be true
switch_1.FrequencyCounter            =    0  // .. needed for Wind
switch_1.LogChange                   =    0  // ..
switch_1.LogState                    =    1  // ..

// switch_1 misc
switch_1.msNominalReportInterval     =   2m
switch_1.usMinLowTime                =   1K
switch_1.usReadingInterval           =   1mK

// switch_1 event-related
switch_1.ReportCumulativeEvents      =   1
switch_1.ReportNewEvents             =   0
switch_1.Rain                        =   0 // boolean
switch_1.ReportEveryNEvents          =   1 // this is the N, not a boolean
switch_1.ReportEventsByTime          =   0
switch_1.RainmmPerCount              =   0.127

// switch_1 frequency-related
switch_1.Damping                     =   0.9
switch_1.MaxPlausibleHz              =  60
switch_1.Observed                    =  'wind speed'
switch_1.WindSpeed                   =   1 // boolean
switch_1.WindMPHPerHz                =   1.492

// ----

// switch_2 modal
switch_2.FrequencyCounter            =    0  // exactly one of these should be true
switch_2.EventCounter                =    1  // needed for rain
switch_2.LogChange                   =    0  // ..
switch_2.LogState                    =    0  // ..

// switch_2 misc
switch_2.msNominalReportInterval     =   2m
switch_2.usMinLowTime                =   1K
switch_2.usReadingInterval           =   1mK

// switch_2 event-related
switch_2.Observed                    = 'rain'
switch_2.ReportCumulativeEvents      =   1
switch_2.ReportNewEvents             =   0
switch_2.Rain                        =   1 // boolean
switch_2.ReportEveryNEvents          =   1 // this is the N, not a boolean
switch_2.ReportEventsByTime          =   0
switch_2.RainmmPerCount              =   0.127

// switch_2 frequency-related
switch_2.Damping                     =   0.9
switch_2.MaxPlausibleHz              =  60
switch_2.WindSpeed                   =   0 // boolean
switch_2.WindMPHPerHz                =   1.492

// ----

VC0706.160x240                       =  0
VC0706.320x240                       =  0
VC0706.640x480                       =  1
VC0706.MotionDetect                  =  0   // ******** not checked ***********
VC0706.Snapshot                      =  1   // ******** not checked ***********
VC0706.usReadingInterval             = 10mK

// ----

voltage_1.Battery                    =  0       // ******** not checked ***********
voltage_1.DividerRatio               =  0.599
voltage_1.MaxVolts                   =  200
voltage_1.MultiplyBy                 =  1.0
voltage_1.Observed                   = 'power left'
voltage_1.Protected                  =  0
voltage_1.ProtectionDiodeDrop        =  0.46   // varies with voltage, 0.44-0.50
voltage_1.ThenAdd                    =  0.02
voltage_1.usReadingInterval          =  2mK

// ----

voltage_2.Battery                    =  0
voltage_2.DividerRatio               =  0.599   // ******** not checked ***********
voltage_2.MaxVolts                   =  200
voltage_2.MultiplyBy                 =  1.0
voltage_2.Observed                   = 'power right'
voltage_2.Protected                  =  1
voltage_2.ProtectionDiodeDrop        =  0.46     // ******** not checked ***********
voltage_2.ThenAdd                    =  1.24
voltage_2.usReadingInterval          = 10mK

